package com.itheima.Demo.Demo2;

public class GirlThread extends Thread {
    public static volatile int money = 10;

    @Override
    public void run() {
        synchronized ("abc") {
            try {
                Thread.sleep(500);
                money -= 5;
                System.out.println("剩余" + money + "元");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
